package com.polly.demo.controller;

import com.polly.demo.dao.PaperRepository;
import com.polly.demo.entity.Paper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PaperController {

    @Autowired
    private PaperRepository paperRepository;
    @RequestMapping("/getPaperByPaperId/{paperId}")
    public Paper getPaper() {
        paperRepository.findAll().forEach(System.out::println);
        Paper paper = paperRepository.findByPaperId(1L);
        System.out.println(paper.getPaperName());
        return paper;
    }

}
